<script setup lang="ts">
import type { categoryType, categoryItem } from '@/types/home'
import { BaseUrl } from '@/utils/request'
// 定义 props 接收数据
const props = defineProps<{ list: categoryType }>()
</script>

<template>
  <view class="category">
    <navigator
      class="category-item"
      hover-class="none"
      v-for="item in props.list"
      :key="item.id"
      :url="`/pages/goods/CategporyGoosList?id=${item.id}`"
    >
      <image class="icon" :src="item.icon"></image>
      <text class="text">{{ item.name }}</text>
    </navigator>
  </view>
</template>
<style lang="scss">
.category {
  display: flex;
  flex-wrap: wrap;
  margin: 20rpx 0 0;
  min-height: 328rpx;
  padding: 10rpx 0;
  .category-item {
    width: 150rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    .icon {
      width: 95rpx;
      height: 95rpx;
    }
    .text {
      font-size: 26rpx;
      color: #666;
    }
  }
}
</style>
